from evcouplings.couplings import CouplingsModel
import pandas as pd
from evcouplings.mutate import predict_mutation_table, single_mutant_matrix


proteus_names=['UBC9_HUMAN','RASH_HUMAN','TIM_SULSO','P84126_THETH','MTH3_HAEAESTABILIZED','KKA2_KLEPN','BLAT_ECOLX','BG_STRSQ','B3VI55_LIPST','AMIE_PSEAE','GFP']

for name in proteus_names:

    c = CouplingsModel("plmc/example/protein/params/"+name+'.params')

    data = pd.read_csv('experiment/'+name+'.tsv')
    reals=[]
    zz=np.array(data)
    for z in zz:
        z = str(z).replace('[', '').replace(']', '').replace('\'', '').replace('\\', '').split('t')
        reals.append([z[0], float(z[1])])
    data=pd.DataFrame(reals,columns=['mut','score'])
    
# predict mutations using our model
    data_pred = predict_mutation_table(
        c, data, "effect_prediction_epistatic"
    )
    
    print(data_pred.head())